package ihm;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JComboBox;
import javax.swing.JButton;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Ajout_Numero_Spectacle extends JFrame implements ActionListener
{

	private JPanel contentPane;
	private JLabel lblAjtSpecNum;
	private JLabel lblAjtNumSpec;
	private JLabel lblAjoutDunNumro;
	private JComboBox cbAjtNumSpec1;
	private JComboBox cbAjtNumSpec2;
	private JButton btnAjouterAjtNumSpec;
	private JButton btnAnnulerAjtNumSpec;
	private JLabel lblPlaceNumSpec;
	private JTextField txtAjtNumSpec;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args)
	{
		EventQueue.invokeLater(new Runnable()
		{
			public void run()
			{
				try
				{
					Ajout_Numero_Spectacle frame = new Ajout_Numero_Spectacle();
					frame.setVisible(true);
				} catch (Exception e)
				{
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Ajout_Numero_Spectacle()
	{
		setTitle("Ajout d'un num\u00E9ro dans un spectacle");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 470, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		lblAjtSpecNum = new JLabel("Spectacle :");
		lblAjtSpecNum.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblAjtSpecNum.setBounds(10, 80, 112, 20);
		contentPane.add(lblAjtSpecNum);
		
		lblAjtNumSpec = new JLabel("Num\u00E9ro :");
		lblAjtNumSpec.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblAjtNumSpec.setBounds(10, 123, 112, 20);
		contentPane.add(lblAjtNumSpec);
		
		lblAjoutDunNumro = new JLabel("Ajout d'un num\u00E9ro dans un spectacle");
		lblAjoutDunNumro.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblAjoutDunNumro.setBounds(75, 11, 301, 26);
		contentPane.add(lblAjoutDunNumro);
		
		cbAjtNumSpec1 = new JComboBox();
		cbAjtNumSpec1.setBounds(127, 82, 114, 20);
		contentPane.add(cbAjtNumSpec1);
		
		cbAjtNumSpec2 = new JComboBox();
		cbAjtNumSpec2.setBounds(127, 125, 114, 20);
		contentPane.add(cbAjtNumSpec2);
		
		btnAjouterAjtNumSpec = new JButton("Ajouter");
		btnAjouterAjtNumSpec.setBounds(188, 225, 118, 26);
		contentPane.add(btnAjouterAjtNumSpec);
		
		btnAnnulerAjtNumSpec = new JButton("Annuler");
		btnAnnulerAjtNumSpec.addActionListener(this);
		btnAnnulerAjtNumSpec.setBounds(326, 224, 118, 27);
		contentPane.add(btnAnnulerAjtNumSpec);
		
		lblPlaceNumSpec = new JLabel("Place du num\u00E9ro :");
		lblPlaceNumSpec.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblPlaceNumSpec.setBounds(10, 169, 112, 20);
		contentPane.add(lblPlaceNumSpec);
		
		txtAjtNumSpec = new JTextField();
		txtAjtNumSpec.setBounds(127, 171, 114, 20);
		contentPane.add(txtAjtNumSpec);
		txtAjtNumSpec.setColumns(10);
	}

	public void actionPerformed(ActionEvent e) 
	{
		if (e.getSource() == btnAnnulerAjtNumSpec) 
		 {	
	       	 dispose(); 
		 }
	}
}
